package org.wsalger.soap;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.util.Log;

public class WebService {
	public static SoapObject getSystemDate(String endpoint,String funName,String in_Str){
		final String LINK_ERROR="连接错误请检查网络";
		final String NAMESPACE = "http://webservice.wsalger.org/";
        //final String ENDPOINT = "http://192.168.11.18:8080/zmbusiness/webservice/zm_webservice";
        final String SOAP_ACTION = ""; 
		try {
			SoapObject rpc = new SoapObject(NAMESPACE, funName);
			//rpc.addProperty("mobileCode", in_Str);
			SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
			envelope.bodyOut = rpc;
			envelope.dotNet = true;
			envelope.setOutputSoapObject(rpc);
			HttpTransportSE transport = new HttpTransportSE(endpoint);
			transport.call(SOAP_ACTION, envelope);
			SoapObject object=(SoapObject) envelope.bodyIn;
			Log.v("RETURN",object.getProperty(0).toString());
			return object;
		} catch (Exception e) {
			Log.v(LINK_ERROR, e.getMessage());
		}
		return null;
	}
}
